function Carrot(x, y) {
	this.x = x;
	this.y = y;
	this.move = 0;
	this.dx = 0;
	this.dx = 0;

}

Carrot.prototype.sayHello = function() {

};

Carrot.prototype.getImg = function(layer,i) {
	var imageObj = new Image();
	imageObj.src="carrot.png";
	var img = new Kinetic.Image({
		image : imageObj,
		x : this.x,
		y : this.y,
		draggable : true,
		  rotation: 2 * Math.PI * i / 5
	});

	img.on('click', function() {
		img.setImage(images[privKey + '_glow']);
      layer.draw();
      document.body.style.cursor = 'pointer';
    });
	
	layer.add(img);
	return img;
	
};

Carrot.prototype.setPicture = function(layer) {

	// anonymous function to induce scope
	
		
		var imageObj = new Image();
		imageObj.src="carrot.png";
		var img = new Kinetic.Image({
			image : imageObj,
			x : this.x,
			y : this.y,
			draggable : true
		});
	
		img.on('click', function() {
			img.setImage(images[privKey + '_glow']);
          layer.draw();
          document.body.style.cursor = 'pointer';
        });
		// make animal glow on mouseover
		img.on('mouseover', function() {
          
          document.body.style.cursor = 'pointer';
        });
	
	layer.add(img);

};

Carrot.prototype.getX = function() {

	return this.x;
};

Carrot.prototype.getY = function() {

	return this.y;
};

Carrot.prototype.getPic = function() {

	return this.pic;
};
Carrot.prototype.startMove = function(bunnyX, bunnyY) {

	this.move = 100;
	this.dx = (bunnyX - this.x) / 100;
	this.dy = (bunnyY - this.y) / 100;
	// alert(" dx:"+this.dx+" dy:"+this.dy+" x:"+this.x+" y:"+this.y+"
	// bunnyX:"+bunnyX+" bunnyY:"+bunnyY);
	// alert("hej");

};

Carrot.prototype.moving = function() {

	if (this.move > 20) {
		this.x = this.x + this.dx;
		this.y = this.y + this.dy;
		this.move--;
		// alert(this.move);
	}
};